import {
	useRequest
} from "./request.js";

import {
	useUserStore
} from "../stores/useUserStore.js";

export const useRateDishesApis = () => {
	const userStore = useUserStore();
	const request = useRequest();

	// 给菜品打分
	function rateDishes(score, dishId) {
		return request.post(`/api/dishes/${dishId}/ratings`, {
			score,

		}, {
			header: {
				authorization: userStore.token
			}
		});
	}

	return {
		rateDishes
	}
}